/**
 * Created by PC on 2016/1/22.
 */
class PomeloManager {

    private static HOST:string = "127.0.0.1";
    private static PORT:string = "3010";

    private static _instance:PomeloManager;
    public static getInstance():PomeloManager {
        if(!this._instance){
            this._instance = new PomeloManager();
        }
        return this._instance;
    }

    private _pomelo:Pomelo;

    public constructor(){
        this._pomelo = new Pomelo();
    }

    public init(handler:Function,context:any):void {
        this._pomelo.init({
            host:PomeloManager.HOST,
            port:PomeloManager.PORT,
        },function(response:any){
            handler.apply(context,[response]);
        })
    }

}